import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types } from 'mongoose';
export type SubscribeDocument = Subscribe & Document;

@Schema()
export class Subscribe {
    @Prop({ required: true,type:Types.ObjectId,ref:'User' })
    follower: Types.ObjectId;

    @Prop({ required: true,type:Types.ObjectId,ref:'User' })
    following: Types.ObjectId;

    @Prop({default: new Date()})
    createtime:Date

    @Prop({default: new Date()})
    updatetime:Date
}

export const SubscribeSchema = SchemaFactory.createForClass(Subscribe);